import DateUtil from "../engine/utils/DateUtil";
import { Logger } from "../engine/utils/Logger";
import { HttpHelper } from "./HttpHelper";

export class IndexDataHelper extends HttpHelper {


    public static index_daily() {
        let params: object = {
            "token": this.token,
            "api_name": "index_daily",
            "params": {
                "ts_code":"000333.SZ",
                "start_date": DateUtil.formatDateStr4(DateUtil.now()),
                "end_date": DateUtil.formatDateStr4(DateUtil.now()),
                
            },
            "fields": ""             //字段列表，用于接口获取指定的字段，以逗号分隔，如"open,high,low,close"
        }
        this.sendHttpRequest(params, this.url, (response, body) => {
            Logger.log("body==", body)
            let bodyObj: object = JSON.parse(body);
            let code: number = bodyObj["code"]
            if (code == 0) {
                let data: object = bodyObj["data"]
              
            } else {
            }
        });
    }

}